home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
dos_win
/
winsock
/
hacklist
/
94-04.Z
/
94-04
/
000007_rcq@mailserv-D.ftp.com_Sat Apr 9 07:28:11 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-04-30
|
3KB
Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AA01251; Sat, 9 Apr 1994 11:29:17 -0400
Received: from ftp.com by ftp.com ; Sat, 9 Apr 1994 11:29:06 -0400
Received: from mailserv-D.ftp.com by ftp.com ; Sat, 9 Apr 1994 11:29:06 -0400
Received: from rcq.hurricane.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
id AA19973; Sat, 9 Apr 94 11:28:11 EDT
Date: Sat, 9 Apr 94 11:28:11 EDT
Message-Id: <9404091528.AA19973@mailserv-D.ftp.com>
To: stcheng@ee.tamu.edu
Subject: Re: setoptsock()
From: rcq@ftp.com (Bob Quinn)
Reply-To: rcq@ftp.com
Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
Sender: rcq@mailserv-D.ftp.com
Repository: mailserv-D.ftp.com, [message accepted at Sat Apr 9 11:28:07 1994]
Originating-Client: hurricane.ftp.com
Content-Length: 2244
> setoptsock() allows socket programmers to modify the socket
> options, like the buffer size for sending and receiving.(using
> level= SOL_SOCKET and optname= SO_RCVBUF and SO_SNDBUF)
>
> My question is when the _receiving_ buffer size is bigger than one UDP packet,
> say 5 times. Will the incoming 5 packets be held in the buffer if
> the app doesn't read it ? Or no matter how big the buffer size is,
> it always holds just one UDP packet and discard the subsequence UDP
> packets if the apps doesn't read it ? What about if the buffer size
> is 5.3 times of the size of the incoming UDP packets , would the
> 6th one be stuffed into the remaining buffer size -- .3 of the UDP
> packet ?
The spec is clear: "if the datagram is larger than the buffer
supplied, the buffer is filled with the first part of the
datagram, the excess data is lost, and recv() returns the
error WSAEMSGSIZE." Where's the ambiguity? Basically, if
you snooze, you lose :)
> And how about the _sending_ buffer for this case ?
I'm not sure how you'd apply the same question to a send(),
but I'll take this opportunity to point out a relevant problem
with send()/sendto() and UDP datagrams.
Our WinSock and stack are incapable of re-assembling incoming
oversized datagrams, but we *can* fragment (out-going) data-
grams. The reason for this asymmetry is simple: to re-assemble
incoming datagrams we would need multiple packet buffers, but
we can use a single packet buffer as we send each outgoing
fragment.
This raises an issue because the WSAData structure only has
one iMaxUdpDg size; it doesn't differentiate betweeen poten-
tially different sending and receiving datagram sizes. The
documentation for send() says it should fail with an error of
WSAEMSGSIZE if "the datagram is larger than the maximum
supported by the Windows Sockets implementation" (e.g. the
iMaxUdpDg value).
I admit, we violate the spec in this regard. But I contend
that we are justified in doing so because the lack of an
asymmetrical send/recv iMaxUdpDg represents a deficiency in
the specification.
Comments?
--
Bob Quinn rcq@ftp.com
FTP Software, Inc. No. Andover, MA